﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace StackBookMvc.Helpers
{
    public class Fbml
    {
        public static string TabItem(string tabName, string actionName, string controllerName, ViewContext vc)
        {
            bool selected = false;
            string url = new UrlHelper(vc.RequestContext).Action(actionName, controllerName);
            if (vc.RouteData.Values["action"].ToString() == actionName && vc.RouteData.Values["controller"].ToString() == controllerName)
            {
                selected = true;
            }
            return String.Format(@"<fb:tab-item href=""{0}"" title=""{1}"" selected=""{2}"" />", url, tabName, selected);
        }
    }
}